/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-05-04 09:50:21
 * @LastEditTime : 2023-07-11 08:26:06
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Router\MenuNav\FirstLevel\Api.jsx
 * @Description  :
 */
import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { OpenExcelButton, SaveExcelButton } from '../Common/options'

export const JiaoAn = async ({ url, OptionsEvent, ClientData, Permission, actionRef }) => {
    let data = {
        pageSize: 10,
        params: { pageIndex: 1 },
        get: API_LIST()[`getFormVisualProgressListJiaoAn`],
        added: `pos${url}`,
        modify: `put${url}`,
        delete: `del${url}`,
        hideInSearch: true,
        columns: [
            commonTableList.uuid,
            {
                dataIndex: 'eventDate',
                title: '日期',
                valueType: 'date',
                ellipsis: true,
                rules: true,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        <OpenExcelButton
                            key="open"
                            title="查看报表"
                            OptionsEvent={OptionsEvent}
                            data={{
                                save: true,
                                url: 'getFormVisualProgressExcelGroupDataJiaoAn',
                                EventDate: record.eventDate,
                            }}
                        />,
                        <SaveExcelButton
                            key="dwon"
                            title="下载报表"
                            api={API_LIST()['getFormVisualProgressExcelGroupDataJiaoAn']}
                            data={{ EventDate: record.eventDate }}
                        />,
                    ]
                },
            },
        ],
    }

    return data
}
